import request from '@/utils/request'

// 查询第三方（承包商）人员分页
export function pageContractorPersonnel(query) {
  return request({
    url: '/specialWork/ContractorPersonnel/page',
    method: 'get',
    params: query,
    factoryId: true
  })
}

// 查询第三方（承包商）人员列表
export function listContractorPersonnel(query) {
  return request({
    url: '/specialWork/ContractorPersonnel/list',
    method: 'get',
    params: query,
    factoryId: true
  })
}

// 查询第三方（承包商）人员详细
export function getContractorPersonnel(id) {
  return request({
    url: '/specialWork/ContractorPersonnel/info/' + id,
    method: 'get',
    factoryId: true
  })
}

// 新增第三方（承包商）人员
export function addContractorPersonnel(data) {
  return request({
    url: '/specialWork/ContractorPersonnel',
    method: 'post',
    data: data,
    factoryId: true
  })
}

// 修改第三方（承包商）人员
export function updateContractorPersonnel(data) {
  return request({
    url: '/specialWork/ContractorPersonnel',
    method: 'put',
    data: data,
    factoryId: true
  })
}

// 删除第三方（承包商）人员
export function delContractorPersonnel(data) {
  return request({
    url: '/specialWork/ContractorPersonnel/remove/batch',
    method: 'delete',
    data,
    factoryId: true
  })
}

// 导出第三方（承包商）人员
export function exportContractorPersonnel(query) {
  return request({
    url: '/specialWork/ContractorPersonnel/export',
    method: 'get',
    params: query,
    factoryId: true
  })
}

// 下载模板第三方（承包商）人员
export function downImportTemplate() {
  return request({
    url: '/specialWork/ContractorPersonnel/importTemplate',
    method: 'get',
    factoryId: true
  })
}
// 上传文件  如果文件需要上传(以file格式)，则需要配置上传函数upload，注意headers要转码
export function uploadFile(data) {
  return request({
      url: '/common/upload',
      method: 'post',
      data,
      headers:{
        'Content-Type': 'multipart/form-data;'
      }
  })
}